package nz.ac.massey.cs.se400_2013.ass3.plugin;

import javax.swing.JPanel;

import nz.ac.massey.cs.se400_2013.ass3.EditorPlugin;
import nz.ac.massey.cs.se400_2013.ass3.Paper;
import nz.ac.massey.cs.se400_2013.ass3.Student;

public class PaperEditor implements EditorPlugin{

	PaperEditorUi editor = new PaperEditorUi();
	@Override
	public JPanel getEditor() {
		return editor;
	}

	@Override
	public void edit(Object obj) {
		this.editor.setName(((Paper)obj).getName());
		this.editor.setId(((Paper)obj).getId());
	}

	@Override
	public boolean canEditInstanceOf(Class type) {
		if(type == Paper.class){
			return true;
		}
		return false;
	}
}


